#ifndef PROTOCOL_H
#define PROTOCOL_H
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<QObject>
typedef unsigned long myuint;

struct UserAccoutInfo
{
    long long _id;
    QString _UserName;
    QString _Pwd;
    long long _OnlineStatus;
    QString _Etc;
};

enum MSG_TYPE
{
    MSG_TYPE_MIN=0,
    MSG_TYPE_USER_REGISER_REQUEST,
    MSG_TYPE_USER_REGISER_RESPOND,
    MSG_TYPE_USER_LOGIN_REQUEST,
    MSG_TYPE_USER_LOGIN_RESPOND,
    MSG_TYPE_SEARCH_ONLINE_REQUEST,
    MSG_TYPE_SEARCH_ONLINE_RESPOND,
    MSG_TYPE_ALLNET_SCAN_ALL_REQUEST,
    MSG_TYPE_ALLNET_SCAN_ALL_RESPOND,
    MSG_TYPE_ADD_FRIEND_REQUEST,
    MSG_TYPE_ADD_FRIEND_RESPOND,
    MSG_TYPE_FRIEND_INFORM_PULL_REQUEST,
    MSG_TYPE_FRIEND_INFORM_PULL_RESPOND,
    MSG_TYPE_GROUP_INFORM_PULL_REQUEST,
    MSG_TYPE_GROUP_INFORM_PULL_RESPOND,
    MSG_TYPE_PULL_FRIEND_LIST_REQUEST,
    MSG_TYPE_PULL_FRIEND_LIST_RESPOND,
    MSG_TYPE_USER_DELETE,
    MSG_TYPE_MAX=LLONG_MAX
};

enum FRIEND_REQUEST_STATUS{
    FRIEND_REQUEST_STATUS_NULL=0,
    FRIEND_REQUEST_STATUS_WAIT_DEAL,
    FRIEND_REQUEST_STATUS_AGREE,
    FRIEND_REQUEST_STATUS_RUFUSE,
};
typedef struct PDU{
    myuint PDULength;
    myuint MessageType;
    myuint Status;
    char caData[128];
    char tagInfo[128];
    myuint MsgLength;
    int msgData[];
}PDU;
PDU *get_PDU(myuint size);
#endif // PROTOCOL_H
